package controllers

/* controller user */

type ID struct {
	Id int `json:"id" validate:"required,gt=0"`
}

type ListPageSize struct {
	Page int `json:"page" validate:"required"`
	Size int `json:"size" validate:"required"`
}

type UserLogin struct {
	Username string `json:"username" validate:"required"`
	Password string `json:"password" validate:"required"`
}

type UserChangePassword struct {
	UserId          int    `json:"id" validate:"required"`
	NewPassword     string `json:"newPassword" validate:"required"`
	ConfirmPassword string `json:"confirmPassword" validate:"required"`
}

/* controller permission */

type RoleAdd struct {
	Role       string `json:"role" validate:"required"`
	Permission string `json:"permission"`
	Menu       string `json:"menu"`
}

type RoleChange struct {
	RoleId     int    `json:"id" validate:"required,gt=0"`
	Role       string `json:"role"`
	Permission string `json:"permission"`
	Menu       string `json:"menu"`
}

type UserAdd struct {
	Username string `json:"username" validate:"required"`
	Nickname string `json:"nickname"`
	IsAdmin  int8   `json:"isAdmin" validate:"oneof=0 1"`
	Role     string `json:"role"`
}

type UserChange struct {
	UserId   int    `json:"id" validate:"required,gt=0"`
	Username string `json:"username"`
	Nickname string `json:"nickname"`
	Role     string `json:"role"`
	IsAdmin  int8   `json:"isAdmin" validate:"oneof=0 1"`
}

type UserEnable struct {
	UserId int  `json:"id" validate:"required,gt=0"`
	Enable int8 `json:"enable" validate:"oneof=0 1"`
}

/* controller log */
type LogInfo struct {
	Username string `json:"username" validate:"required"`
}
